import { defineStore } from 'pinia'
import { ref } from 'vue'
import store from 'store'



export const useSystemStore = defineStore('systemStore', () => {
  //记录令牌
  const token = ref(store.get('access_token'))
  //记录对应的权限列表 数组->对象
  const  perms=ref(store.get('perms'))
  const setPerms = (value) => {
    perms.value=value;
    store.set('perms',value);
  }
  const setToken = (value) => {
    token.value = value
    store.set('access_token', value)
  }

  return {
    token,
    setToken,
    perms,
    setPerms
  }
})

